<div class="row">
  <div class="col-md-6 col-sm-8 col-sm-push-2">
    <form class="form form-horizontal" [formGroup]="metaTemplatesForm">
      <div class="one-form-header"></div>
      <div class="one-form-body">
        <div class="form-group">
          <label for="metaTemplate_update_name" class="col-sm-4 control-label">元模板名称:</label>
          <div class="col-sm-8">
            <input type="text" class="form-control" placeholder="元模板名称" id="metaTemplate_update_name"
                   required formControlName="name">
            <div *ngIf="formErrors.name" class="has-error">
              <label class="control-label"><i class="fa fa-times-circle-o"></i>{{formErrors.name}} </label>
            </div>
          </div>
        </div>

        <div class="form-group">
          <label for="metaTemplate_update_type" class="col-sm-4 control-label" >元模板类型:</label>
          <div class="col-sm-8">
            <!-- 下拉框 -->
            <select class="select" id="metaTemplate_update_type" class="form-control" formControlName="type" required>
              <option value="">-- 请选择元模板类型 --</option>
              <option *ngFor="let typeObj of types" [value]="typeObj.value">{{typeObj.display}}</option>
            </select>
          </div>
        </div>


        <div class="form-group">
          <label for="content" class="col-sm-4 control-label">元模板内容:</label>
          <div class="col-sm-8">
            <textarea id="content" rows="10" placeholder="元模板内容" formControlName="content"></textarea>
            <div *ngIf="formErrors.content" class="has-error">
              <label class="control-label"><i class="fa fa-times-circle-o"></i>{{formErrors.content}} </label>
            </div>
          </div>
        </div>

        <div class="form-group">
          <label for="description" class="col-sm-4 control-label">元模板描述:</label>
          <div class="col-sm-8">
            <textarea id="description" rows="5" placeholder="元模板描述" formControlName="description"></textarea>
            <div *ngIf="formErrors.description" class="has-error">
              <label class="control-label"><i class="fa fa-times-circle-o"></i>{{formErrors.description}} </label>
            </div>
          </div>
        </div>

        <div class="form-group">
          <label for="metaTemplate_update_orderBy" class="col-sm-4 control-label">显示排序:</label>
          <div class="col-sm-8">
            <input type="text" class="form-control" placeholder="显示排序" id="metaTemplate_update_orderBy"
                   formControlName="orderBy">
          </div>
        </div>

        <div class="row">
          <label class="col-sm-4 control-label">是否有效:</label>
          <div class="col-sm-8">
            <div class="row">
              <div class="col-xs-4">
                <input type="radio" id="metaTemplate_update_Use" value="1" formControlName="isUse">
                <label for="metaTemplate_update_Use">
                  有效
                </label>
              </div>
              <div class="col-xs-4">
                <input type="radio" id="metaTemplate_update_inUse" value="0" checked formControlName="isUse">
                <label for="metaTemplate_update_inUse">
                  无效
                </label>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="one-form-footer">
        <div class="pull-right">
          <button class="btn btn-default" type="reset" (click)="cancelMetaTemplateUpdate()">取消</button>
          <button class="btn btn-success" type="button" [disabled]="metaTemplatesForm.invalid" (click)="onSubmit()">提交
          </button>
        </div>
      </div>
    </form>
  </div>
</div>
